Brief Full Advanced Search Search Tips
|  |  | To access the contents, click the chapter and section titles. Visual Basic 6 Programming Blue Book: The Most Complete, Hands-On Resource for Writing Programs with Microsoft Visual Basic 6! (Publisher: The Coriolis Group) Author(s): Peter G. Aitken ISBN: 1576102815 Publication Date: 08/01/98 Search this book:
Previous | Table of Contents | Next
Table 16.6 MCI button commands.
Button | Command Sent To MCI
--- | ---
Back | MCI_STEP
Step | MCI_STEP
Play | MCI_PLAY
Pause | MCI_PAUSE
Prev | MCI_SEEK
Next | MCI_SEEK
Stop | MCI_STOP
Record | MCI_RECORD
Eject | MCI_SET with the MCI_SET_DOOR_OPEN parameter
The Errorcode argument will be zero if the operation completed without an error. It will be set to a non-zero value if the operation did not complete successfully. When an error is detected, you can use the Error and ErrorMessage properties (discussed soon) to determine the nature of the error. The Done event procedure is executed when an MCI command finishes executing. This event procedure is not automatically executed, but rather, is controlled by the Multimedia control’s Notify property. Notify is normally False, which means that the Done event will not be triggered. If you set Notify to True, however, the Done event will be triggered at the completion of the next MCI command executed. This is true both for MCI commands that result from clicking on one of the control buttons and for commands executed by means of the control’s Command property. The Done event procedure is passed a type Integer argument named NotifyCode. The value in this argument indicates the result of the MCI operation that just completed. This value is the same as that in the NotifyValue property, as shown in Table 16.7. Remember that setting Notify to True affects only the next MCI command to be issued—not any subsequent commands or the command currently being executed (if any). You must set Notify to True before each and every MCI command for which you want the Done event procedure triggered. Perhaps you have already seen how the Done event and the ButtonCompleted event make it possible for us to detect when the command has completed executing—something done with a callback function when sending commands directly to the MCI. By knowing when the play operation is complete, you can close the device or perform whatever other actions you need to take. The StatusUpdate event occurs each time the Multimedia control checks the status of the device associated with it. The interval at which this checking occurs is specified by the UpdateInterval property. The default value of 1,000 milliseconds results in status checks every second. Code in the StatusUpdate event procedure can be used to provide the user with information about the current operation, obtained from Multimedia control properties, such as Mode, Length, and Position. Table 16.7 Values for the Done event procedure.
Value | Constant | Result
--- | --- | ---
1 | mciSuccessful | Command completed successfully
2 | mciSuperseded | Command was superseded by another command
4 | mciAborted | Command was aborted by the user
8 | mciFailure | Command failed
Previous | Table of Contents | Next

| Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is prohibited. Read EarthWeb's privacy statement.